-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Client :  127.0.0.1
-- Généré le :  Lun 31 Décembre 2018 à 10:56
-- Version du serveur :  10.1.19-MariaDB
-- Version de PHP :  5.6.28

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Base de données :  `db_procaisse_kitchen`
--

-- --------------------------------------------------------

--
-- Structure de la table `ITEMS`
--

CREATE TABLE `ITEMS` (
  `ID` int(11) NOT NULL,
  `NAME` varchar(255) NOT NULL,
  `QUANTITY` double NOT NULL,
  `ID_LINE` int(11) NOT NULL,
  `STATUS` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `LINES_ORDER`
--

CREATE TABLE `LINES_ORDER` (
  `ID` int(11) NOT NULL,
  `NAME` varchar(255) NOT NULL,
  `STATUS` varchar(255) NOT NULL,
  `QUANTITY` double NOT NULL,
  `SIZE_PRODUCT` varchar(255) DEFAULT NULL,
  `ID_ORDER` int(11) NOT NULL,
  `NUM_LINE` int(1) NOT NULL,
  `TYPE_ORDER` varchar(255) DEFAULT NULL,
  `TIME_SERVED` varchar(255) DEFAULT NULL,
  `COMMENT` varchar(255) DEFAULT NULL,
  `PRINT_WARNING` tinyint(1) NOT NULL DEFAULT '0',
  `COLOR` varchar(255) DEFAULT NULL,
  `NB_PRINT` int(11) NOT NULL DEFAULT '0',
  `LINE_SUIVI` tinyint(1) NOT NULL DEFAULT '0',
  `SEND_COLOR` tinyint(1) NOT NULL DEFAULT '0',
  `HIDDEN` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `ORDERNUM`
--

CREATE TABLE `ORDERNUM` (
  `ID` int(11) NOT NULL,
  `NUM_ORDER` int(11) NOT NULL,
  `INITIALIZD_AT` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Contenu de la table `ORDERNUM`
--

INSERT INTO `ORDERNUM` (`ID`, `NUM_ORDER`, `INITIALIZD_AT`) VALUES
(1, 7, '2018-12-28 09:42:45');

-- --------------------------------------------------------

--
-- Structure de la table `ORDERS`
--

CREATE TABLE `ORDERS` (
  `ID` int(11) NOT NULL,
  `NUMBER_ORDER` int(11) NOT NULL,
  `STATUS` varchar(255) NOT NULL,
  `BIPPER` int(11) NOT NULL,
  `TYPE` varchar(255) NOT NULL,
  `SOURCE` varchar(255) NOT NULL,
  `CREATED` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `UPDATED_AT` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `CANCELED` tinyint(1) NOT NULL DEFAULT '0',
  `DELETED` tinyint(1) NOT NULL DEFAULT '0',
  `ID_TICKET` varchar(256) DEFAULT NULL,
  `SOURCE_CANCEL` varchar(255) DEFAULT NULL,
  `RECALL_BIPPER` tinyint(1) NOT NULL DEFAULT '0',
  `AFTER_RESTART` tinyint(1) NOT NULL DEFAULT '0',
  `NUM_ORDER_KITCHEN` int(11) NOT NULL DEFAULT '0',
  `CLOSED_AT` timestamp NULL DEFAULT NULL,
  `DRESSAGE_COOKING` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `SCREENS`
--

CREATE TABLE `SCREENS` (
  `ID` int(11) NOT NULL,
  `NAME` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `SCREEN_LINE`
--

CREATE TABLE `SCREEN_LINE` (
  `ID` int(11) NOT NULL,
  `ID_LINE` int(11) NOT NULL,
  `ID_SCREEN` int(11) NOT NULL,
  `STATUS` varchar(255) DEFAULT NULL,
  `SOURCE` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `SCREEN_SUPPLEMENT`
--

CREATE TABLE `SCREEN_SUPPLEMENT` (
  `ID` int(11) NOT NULL,
  `ID_SCREEN` int(11) NOT NULL,
  `ID_SUPPLEMENT` int(11) NOT NULL,
  `STATUS` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure de la table `SUPPLEMENTS`
--

CREATE TABLE `SUPPLEMENTS` (
  `ID` int(11) NOT NULL,
  `NAME` varchar(255) NOT NULL,
  `QUANTITY` double NOT NULL,
  `IS_INGREDIENT` tinyint(1) NOT NULL,
  `SOURCE` varchar(255) NOT NULL,
  `ID_LINE` int(11) NOT NULL,
  `ID_ITEM` int(11) DEFAULT NULL,
  `STATUS` varchar(255) DEFAULT NULL,
  `SUPPLEMENT_SUIVI` tinyint(1) NOT NULL DEFAULT '0',
  `COLOR_SUPPLEMENT` varchar(255) DEFAULT NULL,
  `BOLD` tinyint(1) NOT NULL DEFAULT '0',
  `SEND_COLOR` tinyint(1) NOT NULL DEFAULT '0',
  `NUMBER_FLAME` int(11) NOT NULL DEFAULT '0',
  `WEIGHT` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Index pour les tables exportées
--

--
-- Index pour la table `ITEMS`
--
ALTER TABLE `ITEMS`
  ADD PRIMARY KEY (`ID`),
  ADD KEY `ID_LINE` (`ID_LINE`);

--
-- Index pour la table `LINES_ORDER`
--
ALTER TABLE `LINES_ORDER`
  ADD PRIMARY KEY (`ID`),
  ADD KEY `ID_ORDER` (`ID_ORDER`);

--
-- Index pour la table `ORDERNUM`
--
ALTER TABLE `ORDERNUM`
  ADD PRIMARY KEY (`ID`);

--
-- Index pour la table `ORDERS`
--
ALTER TABLE `ORDERS`
  ADD PRIMARY KEY (`ID`);

--
-- Index pour la table `SCREENS`
--
ALTER TABLE `SCREENS`
  ADD PRIMARY KEY (`ID`);

--
-- Index pour la table `SCREEN_LINE`
--
ALTER TABLE `SCREEN_LINE`
  ADD PRIMARY KEY (`ID`),
  ADD KEY `ID_LINE` (`ID_LINE`),
  ADD KEY `ID_SCREEN` (`ID_SCREEN`);

--
-- Index pour la table `SCREEN_SUPPLEMENT`
--
ALTER TABLE `SCREEN_SUPPLEMENT`
  ADD PRIMARY KEY (`ID`),
  ADD KEY `ID_SCREEN` (`ID_SCREEN`),
  ADD KEY `ID_SUPPLEMENT` (`ID_SUPPLEMENT`);

--
-- Index pour la table `SUPPLEMENTS`
--
ALTER TABLE `SUPPLEMENTS`
  ADD PRIMARY KEY (`ID`),
  ADD KEY `ID_LINE` (`ID_LINE`),
  ADD KEY `ID_ITEM` (`ID_ITEM`);

--
-- AUTO_INCREMENT pour les tables exportées
--

--
-- AUTO_INCREMENT pour la table `ITEMS`
--
ALTER TABLE `ITEMS`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `LINES_ORDER`
--
ALTER TABLE `LINES_ORDER`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT pour la table `ORDERNUM`
--
ALTER TABLE `ORDERNUM`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT pour la table `ORDERS`
--
ALTER TABLE `ORDERS`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=53;
--
-- AUTO_INCREMENT pour la table `SCREENS`
--
ALTER TABLE `SCREENS`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT pour la table `SCREEN_LINE`
--
ALTER TABLE `SCREEN_LINE`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT pour la table `SCREEN_SUPPLEMENT`
--
ALTER TABLE `SCREEN_SUPPLEMENT`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `SUPPLEMENTS`
--
ALTER TABLE `SUPPLEMENTS`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- Contraintes pour les tables exportées
--

--
-- Contraintes pour la table `ITEMS`
--
ALTER TABLE `ITEMS`
  ADD CONSTRAINT `items_ibfk_1` FOREIGN KEY (`ID_LINE`) REFERENCES `LINES_ORDER` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Contraintes pour la table `LINES_ORDER`
--
ALTER TABLE `LINES_ORDER`
  ADD CONSTRAINT `lines_order_ibfk_1` FOREIGN KEY (`ID_ORDER`) REFERENCES `ORDERS` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Contraintes pour la table `SCREEN_LINE`
--
ALTER TABLE `SCREEN_LINE`
  ADD CONSTRAINT `screen_line_ibfk_1` FOREIGN KEY (`ID_LINE`) REFERENCES `LINES_ORDER` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `screen_line_ibfk_2` FOREIGN KEY (`ID_SCREEN`) REFERENCES `SCREENS` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Contraintes pour la table `SCREEN_SUPPLEMENT`
--
ALTER TABLE `SCREEN_SUPPLEMENT`
  ADD CONSTRAINT `screen_supplement_ibfk_1` FOREIGN KEY (`ID_SCREEN`) REFERENCES `SCREENS` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `screen_supplement_ibfk_2` FOREIGN KEY (`ID_SUPPLEMENT`) REFERENCES `SUPPLEMENTS` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Contraintes pour la table `SUPPLEMENTS`
--
ALTER TABLE `SUPPLEMENTS`
  ADD CONSTRAINT `supplements_ibfk_1` FOREIGN KEY (`ID_LINE`) REFERENCES `LINES_ORDER` (`ID`) ON DELETE CASCADE,
  ADD CONSTRAINT `supplements_ibfk_2` FOREIGN KEY (`ID_ITEM`) REFERENCES `ITEMS` (`ID`) ON DELETE CASCADE;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
